package com.yxy.controller;

import com.google.zxing.WriterException;
import com.yxy.base.BusinessException;
import com.yxy.base.RestResponse;
import com.yxy.dto.SysLoginInfoDto;
import com.yxy.model.SysLoginInfo;
import com.yxy.service.ZxingService;
import com.yxy.utils.ZxingUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/zxing")
public class ZxingController {

    @Autowired
    ZxingService zxingService;

    @PostMapping("/createQRCodeImage")
    public RestResponse<String> createQRCodeImage() throws BusinessException,WriterException, IOException {
        RestResponse<String> restResponse = new RestResponse<>(200, "成功");
        restResponse.setContent(zxingService.generateQRCodeImage());
        return restResponse;
    }

}
